<template>
  <div>
    <!-- 地址 -->
    <div class="address">
      <div class="send_type">
        {{
          shopInfoObj.shopOrderDetailType.deliverySn === 0
            ? '商家配送'
            : '快递配送'
        }}
      </div>
      <div class="select_address">
        <div class="address_text">
          <div class="user_info">
            <span>{{ shopInfoObj.shopOrderDetailType.customerRealname }}</span>
            {{ shopInfoObj.shopOrderDetailType.customerPhone }}
          </div>
          <div class="text">
            {{ shopInfoObj.shopOrderDetailType.addressDetail }}
          </div>
        </div>
      </div>
    </div>
    <div class="shop_info_warp">
      <div class="type">
        {{
          shopInfoObj.shopOrderDetailType.deliverySn === 0
            ? '商家配送'
            : '快递配送'
        }}
      </div>
      <div class="shop_info">
        <div
          v-for="(item, index) in shopInfoObj.shopOrderDetailType
            .shopOrderProductVo"
          :key="item.productLogoAddress + index"
          class="warp"
        >
          <img :src="imgBaseUrl + item.productLogoAddress" />
          <div class="shop_details">
            <div class="title">{{ item.productName }}</div>
            <div class="specification">({{ item.shopType }})</div>
            <div class="num_price">
              <div class="num">×{{ item.productCnt }}</div>
              <div class="price">￥{{ item.sellPrice }}</div>
            </div>
            <div class="price_item">
              <div class="text">
                {{
                  shopInfoObj.shopOrderDetailType.deliverySn === 0
                    ? '配送费'
                    : '邮费'
                }}
              </div>
              <div class="price">
                ￥{{
                  shopInfoObj.shopOrderDetailType.deliveryFee ? item.postFee : 0
                }}
              </div>
            </div>
          </div>
        </div>
        <div class="price_item">
          <div class="text">小计</div>
          <div class="price">
            ￥{{ shopInfoObj.shopOrderDetailType.orderMoney }}
          </div>
        </div>
        <div class="total_price">
          应付总计：
          <span>￥{{ shopInfoObj.paymentMoney }}</span>
        </div>
        <div
          v-if="isManage"
          class="shop_user"
          @click="toPhone(shopInfoObj.shopOrderDetailType.customerPhone)"
        >
          <van-icon name="service-o" size="1.3rem" />
          <span>联系买家</span>
        </div>
        <div
          v-else
          class="shop_user"
          @click="toPhone(shopInfoObj.shopOrderDetailType.shopPhone)"
        >
          <van-icon name="service-o" size="1.3rem" />
          <span>联系商家</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    shopInfoObj: {
      type: Object,
      default: () => {
        return {}
      },
    },
    isManage: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {}
  },
  methods: {
    toPhone(shopPhone) {
      this.$emit('toPhone', shopPhone)
    },
  },
}
</script>
<style lang="less" scoped>
@import url('../../style/orderDetail/shopOrder.less');
</style>